{{useCss "app-pages/css/cart.scss"}}
<div class="menubox">
    <div class="mleft">
        我的购物车
    </div>
    <div class="mright">
        <button class="btn" event-click="{{'$Event.cart.changToEdit'}}">{{#if $Cache.cart.cartPrivate}}完成{{#else}}编辑{{/if}}</button>
    </div>
</div>
<div class="_cart">
    <div class="cartbox">
        {{#if user.cart_detail.length}} 
        {{#each user.cart_detail}} 
            {{#each goods_info}}
            <div class="_cart_item">
                <div class="ileft">
                    <href to="/goods_details.html?id={{goods_id}}">
                        <img bind-src="{{goods.preview_img_url}}?imageView/1/h/120" />
                    </href>
                </div>
                <div class="imedium">
                    <href to="/goods-details.html?id={{goods_id}}">
                        <div class="name">{{goods.goods_name+' '+goods.intro}}
                        </div>
                    </href>
                    <div class="info">
                        数量：{{num}}
                    </div>
                </div>
                <div class="iright">
                    <div class="_price {{$Top.$Cache.cart.cartPrivate}}">
                        <div>单价</div>
                        <div class="price">￥{{#Fixed goods.price}}</div>
                    </div>
                    <div class="_num">
                        <button class="btn" event-click="{{'$Top.$Event.cart.remove_goods'}}">移除</button>
                        <input event-change="{{'$Top.$Event.cart.update_cart_num'}}" class="num" type="number" min=1 max="100" value="{{num}}" bind-input="{{'num'}}" />
                    </div>
                </div>
            </div>
            {{/each}} 
        {{/each}} 
        <div class="_cart_item">
            <p>总计：{{#Fixed $Top.$Cache.cart.moni_ach.sou_cash}}</p>
            <p>优惠：{{#Fixed $Top.$Cache.cart.moni_ach.sou_cash-$Top.$Cache.cart.moni_ach.cash}}</p>
            <p>运费：{{#Fixed $Top.$Cache.cart.moni_ach.express_cash}}</p>
        </div>
        {{#else}}
        <p>购物车中暂无商品</p>
        {{/if}}
    </div>

    <div class="blockbottom"></div>
    <div class="floatcount">
        <div class="icon-left-open-big" event-click="{{'$Event.cart.cartGoBack'}}"></div>
        <div class="countbox">
            合计：
            <span style="color:red">￥{{#Fixed $Cache.cart.moni_ach.finally_cash}}</span>
            <div class="dem"></div>
            <button event-click="{{'$Event.cart.cart_to_ach'}}">去付款</button>
        </div>
    </div>
</div>
